#ifndef _NormalIntegrator_H_
#define _NormalIntegrator_H_

#pragma once
#include "Integrator.h"

class NormalIntegrator : public Integrator {
private:
	Color background;

public:
	NormalIntegrator(const Color &background) : background(background) {}
	~NormalIntegrator() {}

	Color Li(const Scene *scene, const Ray &ray, const TraceState & traceState) const {
		IntersectResult result;
		if (scene->intersect(result, ray)) {
			return Color(Float(result.normal.x + 1), Float(result.normal.y + 1), Float(result.normal.z + 1)) *= 0.5;
		} else
			return background;
	}
};

#endif // _NormalIntegrator_H_
